﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using  Compose;

namespace ClassLibrary1
{
    [CommandLine.Command(CommandName = "open")]
    public class Class1 : CmdLine
    {
        public Class1() : base("open")
        {
        }

        public override  void Dispose()
        {
            throw new NotImplementedException();
        }

        public override  string Execute(string input)
        {
            try
            {
                System.Diagnostics.Process.Start(input);
                SendMsg("计算", mName + ":" + "打开成功   " + input);
                SendMsg("hello", mName + ":" + "打开成功   " + input);
                return "打开成功   " + input;
            }
            catch (Exception ex)
            {
                return "打开失败   " + ex.Message;
            }


        }

        public override void CallBack(string msg)
        {

            Console.WriteLine(mName + ":" + msg);
        }



        public override string ReceiveMsg(string msg)
        {
            Console.WriteLine(mName + ":" + msg);

            return null;
        }

    }
}
